<?php $this->load->view('common/head');?>
<form class="form-horizontal" name="add" id="add" action="<?php echo $this->input->server('REQUEST_URI'); ?>" method="post">
  <input type="hidden" name="id" id="id" value="<?=isset($offlineData) ? $offlineData['id'] : ''?>">
  <input type="hidden" name="procId" id="procId" value="<?=$procId?>">
  <input type="hidden" name="projectId" id="projectId" value="<?=$projectId?>">
  <table class="table table-bordered">
            <thead>
              <tr>
                <th class="bg-primary">活动地址</th>
                <th class="bg-primary">活动开始时间</th>
                <th class="bg-primary">活动结束时间</th>
                <th class="bg-primary">备注</th>
                <th class="bg-primary">操作</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td>
                	<input type="input" class="form-control" required  name="address" id="address" value="<?=isset($offlineData) ? $offlineData['address'] : ''?>" placeholder="活动地址">
                </td>
                <td>
				   	<input type="input" class="form-control" required date onFocus="WdatePicker({minDate:'<?=($projectData['isBubao'] || $isSpecialBubao) ? $this->timeUnitModel->getTimeUnitStartDate($procData['timeUnit'], $procData['year']) : date('Y-m-d')?>',maxDate:'#F{$dp.$D(\'endTime\')||\'<?=$this->timeUnitModel->getTimeUnitEndDate($procData['timeUnit'], $procData['year'])?>\'}'})" name="startTime" id="startTime" value="<?=isset($offlineData) ? $offlineData['startTime'] : ''?>" placeholder="开始时间">
				</td>
				<td>
				   	<input type="input" class="form-control" required date onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')||\'<?=($projectData['isBubao'] || $isSpecialBubao) ? $this->timeUnitModel->getTimeUnitStartDate($procData['timeUnit'], $procData['year']) : date('Y-m-d')?>\'}',maxDate:'<?=$this->timeUnitModel->getTimeUnitEndDate($procData['timeUnit'], $procData['year'])?>'})" name="endTime" id="endTime" value="<?=isset($offlineData) ? $offlineData['endTime'] : ''?>" placeholder="结束时间">
                </td>
                <td>
                	<textarea class="form-control" name="remarks" id="remarks" rows="3"><?=isset($offlineData) ? $offlineData['remarks'] : ''?></textarea>
                </td>
                <td><button type="submit" class="btn btn-default btn-primary">添加</button></td>
              </tr>
            </tbody>
          </table>
  <div class="form-group">
	<div class="col-sm-offset-5 col-sm-4">
	  <button type="button" onclick="ajaxFormSubmit('add')" class="btn btn-default btn-primary">提交</button>
	  <button type="button" onclick="closeWindow()" class="btn btn-default btn-primary">取消</button>
  	</div>
	  </div>
</form>
<?php $this->load->view('SinglePOffline/detailBudgetList', $this->viewData);?>
<script type="text/javascript">
  $(function(){
    initValidation();
  });
//初始化验证
function initValidation() {
  $('form[name="add"]').find("input,select,textarea").jqBootstrapValidation("destroy");
  $('form[name="add"]').find("input,select,textarea").not("[type=submit]").jqBootstrapValidation({
      preventSubmit:false,
      submitSuccess: function (form, event) {
           event.preventDefault();
           ajaxFormSubmitAndNewWindow('add','添加活动明细', 900, 400);
       },
       submitError: function (form, event, errors) {
         event.preventDefault();
         }
    });
}
</script>
<?php $this->load->view('common/foot');?>